/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package game;

import game.Rendering.GameCanvas;
import game.Rendering.GamePanel;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import java.awt.*;
import java.awt.image.BufferedImage;

/**
 *
 * @author Filippo-TheAppExpert
 */
public class Main {


    public static void main(JFrame gameFrame) {
        new GameCanvas();
    }

    public static void main(String args[]) {

        SwingUtilities.invokeLater(new Runnable() {


            @Override
            public void run() {
                JFrame gameFrame = new JFrame("CS2D");
                GamePanel gp = new GamePanel();
                //Helper.gameFrame = gameFrame;
                //Helper.gp = gp;

                gp.setSize(new Dimension(500, 500));
                gameFrame.add(gp);
                //.setResizable(true);

                gameFrame.pack();
                //gameFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                //gameFrame.setLocationRelativeTo(null);
                gameFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
                //gameFrame.setUndecorated(true);
                gameFrame.setVisible(true);
                gp.requestFocus(); //Set focus to gamepanel (to be listen key presses)



                //GameState gS = new GameState(); ????
            }
        });
    }
}
